<template>
    <el-link class="button-exit" @click="onButtonClick" type="primary">退出</el-link>
</template>

<script>

import {
    mapActions
} from 'vuex' ;

import {
    ElMessageBox
} from 'element-plus' ;

export default {

    methods:{
        ...mapActions('Auth' , [
            'logout'
        ]),

        onButtonClick(){

            ElMessageBox.confirm(
                '是否退出系统',
                'VUE3 应用系统开发模板',
                {
                    confirmButtonText:'是',
                    cancelButtonText:'否',
                    type:'question'
                }
            )
            .then(async () => this.logout())
            .catch(() => {});
        }
    }
} ;

</script>